

<!-- body  start-->


			<!-- END PAGE CONTENT-->
		</div>
	</div>
	<!-- END CONTENT -->
</div>
<!-- END CONTAINER -->

<!-- BEGIN FOOTER -->
<div class="footer">
	<div class="footer-inner">
		 2017 &copy; Weekus.
	</div>
	<div class="footer-tools">
		<span class="go-top">
			<i class="fa fa-angle-up"></i>
		</span>
	</div>
</div>
<!-- END FOOTER -->


<div class="modal fade bs-modal-md" id="change_password_modal" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-md">
    <form method="POST" action="http://www.weekus.com/admin/admin-user/1" accept-charset="UTF-8" id="change_password_form"><input name="_token" type="hidden" value="hGmeySgH0At83BLUryOCWFJ2pkOnvvTcqnzs1tJa">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title">
          修改密码
        </h4>
      </div>
      <div class="modal-body">
        
        <div class="alert alert-danger display-hide">
			<button class="close" data-close="alert"></button>
			<span>
				旧密码错误
			</span>
		</div>

			<div class="form-group">
				<label class="control-label">旧密码</label>
				<input type="password" class="form-control" name="current_password" maxlength="50">
			</div>
			<div class="form-group">
				<label class="control-label">新密码</label>
				<input type="password" class="form-control" name="new_password" maxlength="50">
			</div>
			<div class="form-group">
				<label class="control-label">再次输入新密码</label>
				<input type="password" class="form-control" name="re_password" maxlength="50">
			</div>


      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
        <button type="submit" class="btn btn-primary">确定</button>
      </div>
    </div><!-- /.modal-content -->
    </form>
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
<!-- BEGIN CORE PLUGINS -->
<!--[if lt IE 9]>
<script src="http://www.weekus.com/backend/assets/plugins/respond.min.js"></script>
<script src="http://www.weekus.com/backend/assets/plugins/excanvas.min.js"></script> 
<![endif]-->

<script src="http://www.weekus.com/backend/assets/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="http://www.weekus.com/backend/assets/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js" type="text/javascript"></script>
<script src="http://www.weekus.com/backend/assets/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
<script src="http://www.weekus.com/backend/assets/plugins/jquery.blockui.min.js" type="text/javascript"></script>
<script src="http://www.weekus.com/backend/assets/plugins/jquery.cokie.min.js" type="text/javascript"></script>
<script src="http://www.weekus.com/backend/assets/plugins/uniform/jquery.uniform.min.js" type="text/javascript"></script>
<script src="http://www.weekus.com/backend/assets/plugins/jquery-validation/dist/jquery.validate.min.js" type="text/javascript"></script>
<script src="http://www.weekus.com/backend/assets/plugins/jquery-validation/dist/localization/messages_zh.js" type="text/javascript"></script>
<script src="http://www.weekus.com/backend/assets/plugins/bootbox/bootbox.min.js" type="text/javascript"></script>
<script type="text/javascript" src="http://www.weekus.com/backend/assets/scripts/helper.js"></script>
<script src="http://www.weekus.com/backend/assets/scripts/core/app.js" type="text/javascript"></script>
<script type="text/javascript">
	$(function(){
		App.init();
	});
</script>
<!-- END CORE PLUGINS -->
<!-- END PAGE LEVEL SCRIPTS -->
<!-- END JAVASCRIPTS -->

<script type="text/javascript">
	jQuery(document).ready(function() {
		var active_menu = "li.m-dashboard";

		$(active_menu).addClass('active');
		$(active_menu).parents('li.m-item').addClass('active');


		Helper.validate(
        	'#change_password_form', 
            function (form) {
            	$('#change_password_form .alert-danger').hide();

	        	$.ajax({
					type: "PUT",
		  			url: $(form).prop('action'),
		  			data: { 
	        			current_password: $('#change_password_form input[name=current_password]').val(),  
	        			new_password: $('#change_password_form input[name=new_password]').val(),  
	        			re_password: $('#change_password_form input[name=re_password]').val(),
	        			mode: 'change_password'
	        		}
				}).done(function(data) {
					$('#change_password_modal').modal('hide');
				}).fail(function(jqXHR, textStatus, errorThrown) {
					$('#change_password_form .alert-danger').show().find('span').html(jqXHR.responseJSON.message);
				});
            },
            {
                current_password: {
                    required: true
                },
                new_password: {
                    required: true
                },
                re_password: {
                    equalTo: '#change_password_form input[name=new_password]'
                }
            },
            {
            	re_password: {
                    equalTo: '两次密码输入不相同'
                }
            });

		$('#change_password_modal').on('show.bs.modal', function (e) {
		  $('#change_password_form .alert-danger').hide();
		  $('#change_password_form')[0].reset();
		  $('#change_password_form .has-error').removeClass('has-error').find('.help-block').html('');
		});
	});
</script>
</body>
<!-- END BODY -->
</html>